//========================================================================================
//  
//  $File: $
//  
//  Owner: Toan Nguyen
//  
//  $Author: $
//  
//  $DateTime: $
//  
//  $Revision: $
//  
//  $Change: $
//  
//  Copyright 1997-2008 Adobe Systems Incorporated. All rights reserved.
//  
//  NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance 
//  with the terms of the Adobe license agreement accompanying it.  If you have received
//  this file from a source other than Adobe, then your use, modification, or 
//  distribution of it requires the prior written permission of Adobe.
//  
//========================================================================================
#include "VCPlugInHeaders.h"

// Interface includes:
#include "IPMStream.h"

// Project includes:
#include "AMPIssuesFileNodeID.h"

/**
	@ingroup paneltreeview
*/

/* Compare
*/
int32 AMPIssuesFileNodeID::Compare(const NodeIDClass* nodeID) const
{
	
	const AMPIssuesFileNodeID* fileNode = static_cast<const AMPIssuesFileNodeID*>(nodeID);
	ASSERT(nodeID);
	int res1 = const_cast<AMPIssuesFileNodeID*>(this)->fPath.Compare(kFalse, fileNode->GetPath());
	if (res1 == 0) {
		int res2 = const_cast<AMPIssuesFileNodeID*>(this)->fDisplayName.Compare(kFalse, fileNode->GetDisplayName());
		if (res2 == 0) {
			int res3 = const_cast<AMPIssuesFileNodeID*>(this)->fImgPath.Compare(kFalse, fileNode->GetImgPath());
			//if (res3 == 0) {
				//int res4 = const_cast<AMPIssuesFileNodeID*>(this)->IsDataChecked.Compare(kFalse, fileNode->GetDataChecked());
				//int res4 = const_cast<AMPIssuesFileNodeID*>(this)->IsDataChecked == fileNode->GetDataChecked() ? 0 : 1; 
				//return res4;
			//}
			return res3;
		}
			return res2;
	}
	return res1;
	//return (const_cast<AMPIssuesFileNodeID*>(this)->fPath.Compare(kFalse, fileNode->GetPath()));
}


/* Clone
*/
NodeIDClass* AMPIssuesFileNodeID::Clone() const
{
	// original code
	//return new AMPIssuesFileNodeID(this->GetPath());
	////////////////
	
	// edited by Vu Tiet
	//return new AMPIssuesFileNodeID(this->GetPath(), this->GetDisplayName());
	//return new AMPIssuesFileNodeID(this->GetPath(), this->GetDisplayName(), this->GetImgPath(), this->GetDataType());
	return new AMPIssuesFileNodeID(this->GetPath(), this->GetDisplayName(), this->GetImgPath(), this->GetDataType(), this->GetDataChecked());
	
}


/* Read
*/
void AMPIssuesFileNodeID::Read(IPMStream* stream)
{
	fPath.ReadWrite(stream);
}


/* Write
*/
void AMPIssuesFileNodeID::Write(IPMStream* stream) const
{
	(const_cast<AMPIssuesFileNodeID*>(this)->fPath).ReadWrite(stream);
}

//	end, File:	AMPIssuesDataNode.cpp
